import os
import uuid
class Myfiles:

    def __init__(self):
        self.up_dir = './static/upload/'

    def rename(self, file):
        name = os.path.splitext(file)[1]
        filename = uuid.uuid4().hex + name
        return filename

myf = Myfiles()

name = myf.rename('123123123.jpg')
print(name)

